<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>还款计划</title>
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<link rel="stylesheet" href="../static/css/common/reset.min.css" />
		<link rel="stylesheet" href="../static/css/order/apply_plan.css?v=1" />
	</head>

	<body>
		<div class="body">
			<div class="header">
				<span class="title">共需还款金额(元)</span>
				<div class="money">￥ <b v-text="shouldRepay"></b></div>
				<p>总手续费：
					<span v-text="interestFee"></span>元
				</p>
			</div>
			<div class="main">
				<p class="title_p">每期还款金额</p>
				<li v-for="item in dateList">
					<div v-text="item"></div>
					<div>
						<p v-text="periodShouldRepay"></p>
						<span>含手续费 <span v-text="periodInterestFee"></span>元</span>
					</div>
				</li>
			</div>
			<div class="footer">
				<p>1.利息按日计算，日费率为<span v-text="dayRate"></span>%，逾期费率<span v-text="overdueRate"></span>%</p>
				<p>2.每期还款金额=(贷款本金*每期利率*(1+每期利率)^还款期数)/((1+每期利率)^还款期数-1)</p>
				<p>3.当期逾期费用=当期应还本息*<span v-text="overdueRate"></span>%*逾期天数</p>
				<p>实际以借款相关协议为准</p>
			</div>
		</div>
	</body>
	<script src="../static/js/common.js?v=1"></script>
	<script type="text/javascript" src="../static/js/bridge.js"></script>
	<script type="text/javascript" src="../static/js/common/jquery.min.js"></script>
	<script src="../static/js/common/vue.min.js"></script>
	<script>
		$(function() {
			var domain = apiDomain();
			var webUrl = webDomain();
			var token = getToken();
			new Vue({
				el: ".body",
				data: function() {
					return {
						shouldRepay: "",
						interestFee: "",
						dateList: null,
						overdueRate: "",
						dayRate: "",
						periodShouldRepay: "",
						periodInterestFee: ""
					}
				},
				mounted: function() {
					const that = this;
					this.ajax(that);
				},
				methods: {
					ajax: function(that) {
						$.ajax({
							type: "post",
							url: domain + "/order/repay_plan",
							async: true,
							dataType: "json",
							data: {
								token: token,
								productId: GetQueryString("productId")
							},
							success: function(data) {
								if(data.status == 2000) {
									var obj = data.data;
									that.shouldRepay = obj.shouldRepay;
									that.interestFee = obj.interestFee;
									that.dayRate = obj.dayRate;
									that.overdueRate = obj.overdueRate;
									that.dateList = obj.dateList;
									that.periodShouldRepay = obj.periodShouldRepay;
									that.periodInterestFee = obj.periodInterestFee;
								} else {
									mui.alert(data.message);
								}
							}
						});
					}
				}
			});
		});
	</script>

</html>